/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UML;

import include.fxml.SlyumFX;
import java.util.LinkedList;

/**
 *
 * @author David
 */
public class ClassDiagram {
  
  private String name = "";
  private LinkedList<Type> types = new LinkedList<>();
  
  public ClassDiagram(){
  }
  
  public ClassDiagram(String name){
    this.name = name;
  }
  
  public String getName() { return name.isEmpty() ? SlyumFX.getInstance().rb.getString("noName") : name; }
  public void setName(String name) { this.name = name; }
  
  public boolean addType(Type type)
  {
    if (types.contains(type))
      return false;
    
    return types.add(type);
  }
  
  public boolean removeType(Type type)
  {
    return types.remove(type);
  }
}
